import java.util.Scanner;

public class 二进制计数1 {
    public static void main(String[] args) {
        Scanner scn  = new Scanner(System.in);
        while (scn.hasNext()) {
            int n = scn.nextInt();
            int count = 0;
            while(n !=0){
                if((n&1) !=0){
                    count++;
                }
                    n >>>= 1;
            }
            System.out.println(count);
        }

    }
}
